package net.maku.project.service;

import net.maku.framework.common.utils.PageResult;
import net.maku.framework.mybatis.service.BaseService;
import net.maku.project.vo.ProcessStagesVO;
import net.maku.project.query.ProcessStagesQuery;
import net.maku.project.entity.ProcessStagesEntity;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 流程阶段表
 *
 * @author 艾力 1106997025@qq.com
 * @since 1.0.0 2024-07-09
 */
public interface ProcessStagesService extends BaseService<ProcessStagesEntity> {

    PageResult<ProcessStagesVO> page(ProcessStagesQuery query);

    void save(ProcessStagesVO vo);

    void update(ProcessStagesVO vo);

    // 更新流程阶段表的结束时间
    void updateStageEndTime(Long stageId, LocalDateTime endTime);

    void delete(List<Long> idList);

    List<ProcessStagesVO> getByProjectId(Long projectId);


    LocalDateTime getStarTimeByProjectIdWithStage(Long projectId, String stageName);

    ProcessStagesEntity getStageByProjectIdAndStageId(Long projectId, Long stageId);

    void updateNextStageStarTime(String nextStatusName, Long projectId);

    boolean stageIsAllCompleted(Long projectId);
}